* {
  box-sizing: border-box;
}

body {
  background-color: #efcdd6;
  display: flex;
  /* 纵轴排列 */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: 0;
  /* 因为后面要做切入动画，要把盒子放到屏幕外，为了不显示滚动条，所以隐藏 */
  overflow-x: hidden;
}

h1 {
  margin: 10px;
}

.box {
  background-color: steelblue;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 400px;
  height: 200px;
  margin: 10px;
  border-radius: 10px;
  box-shadow: 2px 4px 5px rgba(0, 0, 0, 0.3);
  transform: translateX(400%);
  transition: transform 0.4s ease;
}



/* 选择box类型的属性 后面跟1就是选择第一个，跟1n就是选择每一个，跟2n就是只选第偶数个*/
.box:nth-of-type(even) {
  transform: translateX(-400%);
}

.box.show {
  transform: translateX(0);
}

.box h2 {
  font-size: 45px;
}